package leetcode算法面试题.字符串;

public class 有效的字母异位 {
    class Solution{
        public boolean isAnagram(String s,String t){
            int[] record = new int[26];
            for (char c :
                    s.toCharArray()) {
                record[c - 'a'] += 1;
            }
            for (char c :
                    t.toCharArray()) {
                record[c - 'a'] -= 1;
            }
            for (int i :
                    record) {
                if (i!=0){
                    return false;
                }
            }
              return true;
        }
    }
}
